package redisClient

import (
	"context"
	"gitee.com/andrewgithub/go-redis/v9"
)

type RedisCommand struct {
	client *redis.Client //  redis客户端
	ctx    context.Context
}

var (
	redisClient *RedisCommand
)

func init() {
	redisClient = NewRedisCommand("127.0.0.1:6379")
	redisClient.ctx = context.Background()
}

func NewRedisCommand(address string) *RedisCommand {
	return &RedisCommand{client: redis.NewClient(&redis.Options{
		Addr:     address,
		Password: "",
		DB:       0,
	}),
		ctx: context.Background()}
}

//func (c *RedisCommand) Set(key string, value string) (string, error) {
//	// 设置键值对，
//	c.client.Set(ctx, key, value, 0)
//
//	return "", nil
//}
